<?php
namespace Home\Controller;
use Think\Controller;

class IndexController extends BaseController    {


    public function _initialize()
    {
        parent::_initialize();
    }

    public function index(){
        header("Content-Type:text/html; charset=utf-8");

        $callback = $_GET['callback'];
        $this->assign('callback',$callback.$_SESSION['openid']);
        $Lock = M('locktable');

        $locklist = $Lock->select();

        foreach ($locklist as $item){
            $this->assign('x'.$item['id'].'name',$item['lockname']);
            $this->assign('x'.$item['id'].'saleprice','￥'.$item['price']);
            $this->assign('x'.$item['id'].'trueprice','￥'.$item['trueprice']);
        }



        $from = $_GET['from'];
        $f = $_GET['f'];
        if(!is_null($from)){
            $this->assign('from',$from);
        }else if (!is_null($f)){
            $this->assign('from',$f);
        }else{
            $this->assign('from','');
        }
//         var_dump($locklist);exit;


        $this->display();


    }

    public function about(){
        $this->display();
    }
}